home *** CD-ROM | disk | FTP | other *** search
- #include "../../manic.h"
- #include "common.h"
- #include "../gfx.h"
-
- void
- mm_gfx_putpixel (uint_fast16_t x, uint_fast16_t y, uint_fast8_t col)
- {
- putpixel (buffer, x + xoffset, y + yoffset, col);
- }
-
- void
- mm_gfx_putpixel2 (uint_fast16_t x, uint_fast16_t y, uint_fast8_t col)
- {
- putpixel (buffer, x, y, col);
- }
-
- uint_fast8_t
- mm_gfx_getpixel (uint_fast16_t x, uint_fast16_t y)
- {
- return (getpixel (buffer, x + xoffset, y + yoffset));
- }
-
- uint_fast8_t
- mm_gfx_getpixel2 (uint_fast16_t x, uint_fast16_t y)
- {
- return (getpixel (buffer, x, y));
- }
-
- void
- mm_gfx_cls (uint_fast8_t col)
- {
- clear_to_color (buffer, col);
- }
-
- void
- mm_gfx_flush (void)
- {
- mm_gfx_waitvr ();
- if (DoubleSize)
- stretch_blit (buffer, screen, 0, 0, scrnwidth, scrnheight,
- 0, 0, SCREEN_W, SCREEN_H);
- else
- blit (buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
- }
-
- void
- mm_gfx_waitvr (void)
- {
- vsync ();
- }
-
- void
- mm_gfx_fillbox (uint_fast16_t xpos, uint_fast16_t ypos,
- uint_fast16_t width, uint_fast16_t height, uint_fast8_t col)
- {
- rectfill (buffer, xpos + xoffset, ypos + yoffset,
- xpos + xoffset + width - 1, ypos + yoffset + height - 1, col);
- }
-
- void
- mm_gfx_fillbox2 (const uint_fast16_t xpos, const uint_fast16_t ypos,
- const uint_fast16_t width, const uint_fast16_t height,
- const uint_fast8_t col)
- {
- rectfill (buffer, xpos, ypos, xpos + width - 1, ypos + height - 1, col);
- }
-
- void
- mm_gfx_palset (uint_least8_t * palette)
- {
- PALETTE allegpal;
-
- int_fast16_t i;
-
- for (i = 0; i < 256; i++) {
- allegpal[i].r = palette[(i * 3)];
- allegpal[i].g = palette[(i * 3) + 1];
- allegpal[i].b = palette[(i * 3) + 2];
- }
-
- set_palette (allegpal);
- }
-